package timehelp

import "time"

var (
	formatDate = "2006-01-02"
)

func DateToStr(tDate time.Time) string {
	return tDate.Format(formatDate)
}

func FmtDate(tm time.Time, layout string) string {
	return tm.Format(layout)
}

func StrToDate(strDate string) (time.Time, error) {
	return time.ParseInLocation(formatDate, strDate, time.Local)
}
